var ut = require("../../utils/util.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    "fittop": 0,
    "bar_Height": wx.getSystemInfoSync().statusBarHeight,
    "widnowW": wx.getSystemInfoSync().screenWidth,
    head_nav_list: [{
        name: "订单总数",
        url: "user-order",
        count: 10
      },
      {
        name: "商品收藏",
        url: "user-faovr",
        count: 1110
      },
      {
        name: "我的足迹",
        url: "user-goods-browse",
        count: 1230
      },
      {
        name: "我的积分",
        url: "user-integral",
        count: 3433333444445
      },
    ],
    user_order_status_list: [{
        name: "待付款",
        count: 0
      },
      {
        name: "待发货",
        count: 0
      },
      {
        name: "待收货",

        count: 0
      },
      {
        name: "已完成",

        count: 0
      },
    ],
    nav_lists: [{
        url: "user-order",
        icon: "/images/user-nav-order-icon.png",
        name: "我的订单",
      },
      {
        url: "user-address",
        icon: "/images/user-nav-address-icon.png",
        name: "我的地址"
      },
      {
        url: "user-faovr",
        icon: "/images/user-nav-faovr-icon.png",
        name: "我的收藏"
      },
      {
        url: "user-answer-list",
        icon: "/images/user-nav-customer-service-icon.png",
        name: "客服消息"
      },
      {
        url: "user-answer-list",
        icon: "/images/user-nav-invitor-icon.png",
        name: "我的粉丝"
      }
    ]
  },
  "fitscreen": function() {
    if (this.data['widnowW'] >= 768) {
      this.setData({
        "fittop": 30
      })
    }
  },
  navToOrder: function(e) {
    var that = this
    var index = e.currentTarget.dataset.index
    switch (index) {
      case 0:
        wx.navigateTo({
          url: '/pages/wait_payment/wait_payment',
        });
      case 1:
        wx.navigateTo({
          url: '/pages/wait_shipments/wait_shipments',
        });
      case 2:
        wx.navigateTo({
          url: '/pages/wait_receive_goods/wait_receive_goods',
        });
      case 3:
        wx.navigateTo({
          url: '/pages/finished_order/finished_order',
        });
    }

  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var that = this
    that.fitscreen();
    wx.request({
      url: 'http://192.168.0.106:8080/a/sys/user/hello',
      success: function(res) {
        console.log(res)
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})